<%--
    Document   : home
    Created on : Apr 6, 2011, 3:37:32 PM
    Author     : Dine
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<html>
    <head>
        <sj:head jqueryui="true" jquerytheme="south-street" compressed="false"/>
        <jsp:include page="WEB-INF/fragments/globalHead.html"/>
        <title>Cashmate <s:property value="#session.branch.branchname"/> - Administration</title>
        <style type="text/css">
            div#contentContainer{
                width:1010px;
                margin-left:240px;
                margin-top:5px;
                height:592px;
                opacity:0.8;
            }
            div#adminLinkContainer{
                width:200px;
                margin:10px auto;
                display: block !important;
            }
            .adminLink{
                font-size: 14px;
                width:100%;
            }
            div#theContent{
                width:990px;
                overflow:auto;
                margin:auto;
                height:535px;
            }
            div.gridOptsContainer{
                width:800px;
                margin:auto;
                text-align: center;
            }
            div.ui-jqgrid{
                margin:auto;
            }
            span.ui-jqgrid-title{
                font-size: 20px;
                text-align: center;
                margin: auto;
            }
            table.ui-jqgrid-btable{
                font-size:12px !important;
            }
            table.ui-jqgrid-htable{
                font-size:14px !important;
            }

            #first label{
                margin-right:7em;
            }

            #first input{
                margin-right:5em;
            }

            #ccrinfo button.ui-datepicker-trigger,#ccreport button.ui-datepicker-trigger{
                display:none;
            }

            #deposit,#collection,#check,#cash,#addtlfund,#bankdebit,#bankcredit{
                overflow:auto;
                height:125px;
                width:950px;
            }

            #second input{
                width:105px;
            }

            #cash input,#cash label,#addtlfund input,#addtlfund label{
                width:130px;
            }

            #gview_ccrdebitGrid,#gview_ccrcreditGrid,#gview_ccrfundGrid,#gview_ccrcashGrid,#gview_collectionsGrid,#gview_ccrGrid,
            #gview_ccrcheckGrid,#gview_depositsGrid,#gview_borrowerinfoGrid,#gview_collateralGrid{
                height:430px;
                overflow:auto;
            }

            #empcode,#empname,#acctnum{
                background-color: #ddd;
            }
        </style> <!--main.jsp css-->
        <script type="text/javascript">
            $(document).ready(function(){
                var selected = "${param.grid}";
                if(selected){
                    $('.adminLink').removeClass("ui-state-highlight");
                    $("#"+selected).addClass("ui-state-highlight");
                    var title = $("#"+selected).attr("title");
                    $("#contentHeader").html(title);
                }

                $('.adminLink').click(function(){
                    var element = this.id;
                    window.location.href="admin.jsp?grid="+element;
                });
            });
        </script> <!--main.jsp script-->
    </head>
    <body>

        <%--
        <c:if test="${sessionScope.auth == null}">
            <jsp:forward page="index.jsp?auth=none"/>
        </c:if>
        <s:set var="type" value="#session.userType.type"/>
        <s:if test="%{#type != 'Administrator'}">
            <jsp:forward page="WEB-INF/error/unauthorized.html"/>
        </s:if>
        --%>
        <s:div id="bodyContainer">
            <s:div id="logoContainer" cssClass="ui-widget-content ui-corner-all">
                <s:include value="WEB-INF/fragments/banner.jsp">
                    <s:param name="branch" value="#session.branch.branchname" />
                </s:include>
            </s:div>
            <jsp:include page="WEB-INF/fragments/top.jsp"/>
            <s:div id="leftContainer" cssClass="ui-widget-content ui-corner-all">
                <s:div id="adminLinkContainer">
                    <sj:a button="true"
                          id="employee"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-person"
                          title="Employees Administration"
                          >
                        Employees
                    </sj:a>
                    <sj:a button="true"
                          id="roles"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-key"
                          title="Roles & Privileges Administration"
                          >
                        Roles &amp; Privileges
                    </sj:a>
                    <sj:a button="true"
                          id="branches"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-home"
                          title="Branches Administration"
                          >
                        Branches
                    </sj:a>
                    <sj:a button="true"
                          id="areas"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-image"
                          title="Areas Administration"
                          >
                        Areas
                    </sj:a>
                    <sj:a button="true"
                          id="documents"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-document"
                          title="Documents Administration"
                          >
                        Documents
                    </sj:a>
                    <sj:a button="true"
                          id="borrower"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-star"
                          title="Borrowers Administration"
                          >
                        Borrowers
                    </sj:a>
                    <sj:a button="true"
                          id="loanapplication"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-folder-open"
                          title="Borrower's Loan Applications Administration"
                          >
                        Loan Applications
                    </sj:a>
                    <sj:a button="true"
                          id="requirement"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-pin-s"
                          title="Loan Application Requirements Administration"
                          >
                        Requirements
                    </sj:a>
                    <sj:a button="true"
                          id="loan"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-folder-collapsed"
                          title="Borrower's Loans Administration"
                          >
                        Loans
                    </sj:a>
                    <sj:a button="true"
                          id="appraisal"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-search"
                          title="Borrower's Loan Appraisals Administration"
                          >
                        Appraisals
                    </sj:a>
                    <sj:a button="true"
                          id="business"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-calculator"
                          title="Borrower's Businesses Administration"
                          >
                        Businesses
                    </sj:a>
                    <sj:a button="true"
                          id="charref"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-copy"
                          title="Borrower's Character References Administration"
                          >
                        Character References
                    </sj:a>
                    <sj:a button="true"
                          id="dependents"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-heart"
                          title="Borrower's Dependents"
                          >
                        Dependents
                    </sj:a>
                    <sj:a button="true"
                          id="reputation"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-check"
                          title="Borrower's Reputations"
                          >
                        Reputations
                    </sj:a>
                    <sj:a button="true"
                          id="matrixcategories"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-tag"
                          title="Matrix Categories Administration"
                          >
                        Matrix Categories
                    </sj:a>
                    <sj:a button="true"
                          id="matrixcriteria"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-contact"
                          title="Matrix Criteria Administration"
                          >
                        Matrix Criteria
                    </sj:a>
                    <sj:a button="true"
                          id="creditinvestigation"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Credit Investigations Administration"
                          >
                        Credit Investigations
                    </sj:a>
                    <sj:a button="true"
                          id="additionalfund"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Additional Funds Administration"
                          >
                        Additional Funds
                    </sj:a>
                    <sj:a button="true"
                          id="bankcreditmemo"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Bank Credit Memo Administration"
                          >
                        Bank Credit Memo
                    </sj:a>
                    <sj:a button="true"
                          id="bankdebitmemo"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Bank Debit Memo Administration"
                          >
                        Bank Debit Memo
                    </sj:a>
                    <sj:a button="true"
                          id="cashdisbursement"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Cash Disbursement Administration"
                          >
                        Cash Disbursement
                    </sj:a>
                    <sj:a button="true"
                          id="checkdisbursement"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Check Disbursement Administration"
                          >
                        Check Disbursement
                    </sj:a>
                    <sj:a button="true"
                          id="cashcustodianreport"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Cash Custodian Report Administration"
                          >
                        Cash Custodian Report
                    </sj:a>
                    <sj:a button="true"
                          id="borrowerinfo"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Borrower Information Administration"
                          >
                        Borrower Information
                    </sj:a>    
                    <sj:a button="true"
                          id="collateral"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Collaterals Administration"
                          >
                        Collaterals
                    </sj:a>
                    <sj:a button="true"
                          id="creditmatrix"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Credit Matrix Administration"
                          >
                        Credit Matrix
                    </sj:a>
                    <sj:a button="true"
                          id="documentspassed"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Documents Passed Administration"
                          >
                        Documents Passed
                    </sj:a>
                    <sj:a button="true"
                          id="products"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Products Administration"
                          >
                        Products
                    </sj:a>
                    <sj:a button="true"
                          id="typeofcollateral"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Type of Collateral Administration"
                          >
                        Type of Collateral
                    </sj:a>
                    <sj:a button="true"
                          id="usertypes"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Usertypes Administration"
                          >
                        Usertypes
                    </sj:a>
                    <sj:a button="true"
                          id="modules"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Modules Administration"
                          >
                        Modules
                    </sj:a> 
                    <sj:a button="true"
                          id="sourceofincome"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Source of Income Administration"
                          >
                        Source of Income
                    </sj:a>
                    <sj:a button="true"
                          id="othersourceofincome"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Other Source of Income Administration"
                          >
                        Other Source of Income
                    </sj:a>
                    <sj:a button="true"
                          id="furnishingsandequipment"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Furnishings and equipment Administration"
                          >
                        Furnishings and equipment
                    </sj:a>
                    <sj:a button="true"
                          id="informants"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Informants Administration"
                          >
                        Informants
                    </sj:a>
                    <sj:a button="true"
                          id="loanswithotherbanks"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Loans w/ other banks Administration"
                          >
                        Loans w/ other banks
                    </sj:a>
                    <sj:a button="true"
                          id="log"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Log Administration"
                          >
                        Log
                    </sj:a>
                    <sj:a button="true"
                          id="matrixcategories_criteria"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Matrix Categories Criteria Administration"
                          >
                        Matrix Categories Criteria
                    </sj:a>
                    <sj:a button="true"
                          id="matrixincome"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Matrix Income Administration"
                          >
                        Matrix Income
                    </sj:a>
                    <sj:a button="true"
                          id="monthlyincome"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Monthly Income Administration"
                          >
                        Monthly Income
                    </sj:a>
                    <sj:a button="true"
                          id="notesreceivable"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Notes Receivable Administration"
                          >
                        Notes Receivable
                    </sj:a>
                    <sj:a button="true"
                          id="property"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Personal and Real Properties Administration"
                          >
                        Personal and Real Properties
                    </sj:a>
                    <sj:a button="true"
                          id="rates"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Rates Administration"
                          >
                        Rates
                    </sj:a>
                    <sj:a button="true"
                          id="request"
                          cssClass="adminLink"
                          buttonIcon="ui-icon-suitcase"
                          title="Request Administration"
                          >
                        Request
                    </sj:a>
                </s:div>
            </s:div>
            <s:div id="contentContainer" cssClass="ui-widget-content ui-corner-all">
                <h1 id="contentHeader" style="text-align:center;" class="ui-state-default ui-corner-all"><span id="level1">Cashmate Administration Module</span></h1>
                <s:div id="theContent">
                    <c:if test="${param.grid == null}">
                        <h2>Admin Home</h2>
                    </c:if>
                    <c:if test="${param.grid != null}">
                        <jsp:include page="WEB-INF/fragments/admin/${param.grid}.jsp"/>
                    </c:if><%-- Employee Grid--%>
                </s:div>
                <%--
                <h1>Welcome to Cashmate Credit Corporation</h1>
                <h2><s:property value="#session.branch.branchname"/> Branch</h2>
                <s:div id="tutorial">
                    <h3>Tutorial</h3>
                </s:div>
                <s:div id="about">
                    <h3>About Cashmate</h3>
                </s:div>
                <s:div id="memorandum">
                    <h3>Memorandum by the President</h3>
                    <ol>
                        <li>asdasd</li>
                        <li>asdasd</li>
                        <li>asdasd</li>
                        <li>asdasd</li>
                        <li>asdasd</li>
                        <li>asdasd</li>
                    </ol>
                </s:div>
                <!-- Below are samples-->
                <s:div id="sample">
                    <h3>SAMP            LES</h3>
                    <h4>Select tag</h4>
                    <s:action name="get-employees!list" executeResult="false" var="e"/>
                    <s:form action="submit" cssStyle="float:left;">
                        <s:select label="Employees"
                                  list="#e.employees"
                                  multiple="true"
                                  name="selectedEmployee"
                                  />
                        <s:submit />
                    </s:form>

                    <h4>Add Employee</h4>
                    <s:set name="stat" value="status"/>
                    <s:if test="%{#stat!='ok'}">
                        <dl class="ui-state-error ui-corner-all">
                            <dt><span class="ui-icon ui-icon-alert"></span><s:property value="#stat"/></dt>
                        </dl>
                    </s:if>
                    <s:elseif test="%{#stat=='ok'}">
                         <dl class="ui-state-hightlight ui-corner-all">
                            <dt><span class="ui-icon ui-icon-info"></span>Employee Registered.</dt>
                        </dl>
                    </s:elseif>
                    <s:action name="get-branches!branches" executeResult="false" var = "b"/>
                    <s:form action="add-employee" cssClass="forms">
                        <s:textfield key="emp.employeeid" label="ID Number" maxLength="7"/>
                        <s:textfield key="emp.firstname" label="First Name" maxLength="45"/>
                        <s:textfield key="emp.middlename" label="Middle Initial" maxLength="3"/>
                        <s:textfield key="emp.lastname" label="Last Name"  maxLength="45"/>
                        <s:password key="emp.password" label="Password" maxLength="12"/>
                        <s:password name="confirmPass" label="Confirm Password" maxLength="12"/>
                        <s:textfield key="emp.employeetype" label="employee type"  maxLength="45"/>
                        <s:select list="#b.brList" label="Branch" name="selectedBranch" listKey="branchcode"
                                  listValue="branchname" headerKey="-1" headerValue="Select Branch"/>

                        <s:submit cssClass="ui-state-default ui-corner-all button"/>
                    </s:form>

                    <h4>Grid</h4>
                        <s:url id="remoteurl" action="grid-employee"/>
                        <sjg:grid
                            id="gridtable"
                            caption="Cashmate Employees"
                            dataType="json"
                            href="%{remoteurl}"
                            pager="true"
                            gridModel="gridModel"
                            rowList="10,15,20"
                            rowNum="15"
                            rownumbers="true"
                            sortable="true"
                            viewrecords="true"

                        >
                            <sjg:gridColumn name="employeeid" index="employeeid" title="ID" sortable="true"/>
                            <sjg:gridColumn name="name" index="name" title="Name" sortable="true"/>
                            <sjg:gridColumn name="employeetype" index="employeetype" title="User Type" sortable="true"/>
                        </sjg:grid>
                --%>
            </s:div>
            <jsp:include page="WEB-INF/fragments/bottom.jsp"/>
        </s:div>
    </body>
</html>
